package co.gov.medellin.ssti.sub.model.dao;

import java.sql.SQLException;
import java.util.Collection;
import java.util.List;

import co.gov.medellin.ssti.sub.model.dao.exception.DAOException;
import co.gov.medellin.ssti.sub.model.vo.ProgramaVO;

/**
 * 
 * @author Consultsoft4
 * 
 */
public interface IProgramaDAO extends BaseDAO {
	/**
	 * 
	 * @return
	 * @throws DAOException
	 */
	List<ProgramaVO> loadAllProgramas() throws DAOException;

	/**
	 * 
	 * @param secretaryCode
	 * @return
	 * @throws SQLException
	 */
	List<ProgramaVO> loadAllProgramasByArea(String secretaryCode)
			throws DAOException;

	/**
	 * 
	 * @param codeUser
	 * @param userGroupName
	 * @param codeArea
	 * @return
	 * @throws DAOException
	 */
	Collection<ProgramaVO> findProgramaByUserReport(Long codeUser,
			String userGroupName, Long codeArea) throws DAOException;

	// ///

	/**
	 * 
	 * @param criteria
	 * @return
	 * @throws DAOException
	 */
	Collection<ProgramaVO> findProgramaByCriteria(ProgramaVO criteria)
			throws DAOException;

	/**
	 * 
	 * @param criteria
	 * @return
	 * @throws DAOException
	 */
	Collection<ProgramaVO> findAllProgramaByCriteria(ProgramaVO criteria)
			throws DAOException;

	/**
	 * 
	 * @param criteria
	 *            bean with all data to filter the query.
	 * @param codeUser
	 *            code of the user at the moment connected
	 * @param groupUserName
	 *            Name of the user group
	 * @param areaUser
	 *            Code of the area to which the user belongs
	 * @notes This method returns all the programs to which a user has
	 *        permission, as long as they are associate to a seat
	 * @author Carlos Ruiz & Daniel Monsalve
	 * @date 04/05/2007
	 * @return Collection with the programs
	 * @throws java.sql.SQLException
	 */
	Collection<ProgramaVO> findProgramaByCriteria(ProgramaVO criteria,
			Long codeUser, String groupUserName, Long areaUser)
			throws DAOException;

	/**
	 * 
	 * @param criteria
	 * @param codeUser
	 * @param groupUserName
	 * @param areaUser
	 * @return
	 * @throws DAOException
	 */
	Collection<ProgramaVO> findProgramaByCriteriaOB(ProgramaVO criteria,
			Long codeUser, String groupUserName, Long areaUser)
			throws DAOException;

	/**
	 * 
	 * @param criteria
	 * @param codeUser
	 * @param groupUserName
	 * @param areaUser
	 * @return
	 * @throws DAOException
	 */
	Collection<ProgramaVO> findProgramaWithoutSede(ProgramaVO criteria,
			Long codeUser, String groupUserName, Long areaUser)
			throws DAOException;

	/**
	 * 
	 * @param criteria
	 *            bean with all data to filter the query.
	 * @param groupUserName
	 *            Name of the user group
	 * @param codeUser
	 *            code of the user at the moment connected
	 * @param Code
	 *            of the area to which the user belongs
	 * @notes This method returns all the programs to which a user has
	 *        permission.
	 * @return Collection with the programs
	 * @throws java.sql.SQLException
	 */
	Collection<ProgramaVO> findProgramaByCriteria(ProgramaVO criteria,
			String groupUserName, Long codeUser, Long areaUser)
			throws DAOException;

	// Metodo que ejecuta la busqueda de programas para el reporte detallado
	// de beneficios otorgados
	/**
	 * 
	 * @param criteria
	 * @param groupUserName
	 * @param codeUser
	 * @param areaUser
	 * @return
	 * @throws DAOException
	 */
	Collection<ProgramaVO> findProgramaByCriteriaReport(ProgramaVO criteria,
			String groupUserName, Long codeUser, Long areaUser)
			throws DAOException;

	/**
	 * 
	 * @param groupUserName
	 * @param codeUser
	 * @param areaUser
	 * @return
	 * @throws DAOException
	 */
	Collection<ProgramaVO> findProgramaWithoutVigencia(String groupUserName,
			Long codeUser, Long areaUser) throws DAOException;

	/**
	 * Autor DORIS
	 * 
	 * @param codePrograma
	 * @return
	 */
	boolean EstadoPrograma(ProgramaVO criteria);

	/**
	 * Autor DORIS
	 * 
	 * @param codePrograma
	 * @return
	 */
	int getActivarProg(ProgramaVO criteria);

	/**
	 * 
	 * @param criteria
	 * @param groupUserName
	 * @param codeUser
	 * @param areaUser
	 * @param controlAcceso
	 * @return
	 * @throws DAOException
	 */
	Collection<ProgramaVO> getProgramasVigentes(ProgramaVO criteria,
			String groupUserName, Long codeUser, Long areaUser,
			boolean controlAcceso) throws DAOException;

	/**
	 * 
	 * @param strCodeProg
	 * @return
	 * @throws DAOException
	 */
	String getNameByCode(String strCodeProg) throws DAOException;

	/**
	 * 
	 * @param criteria
	 * @param groupUserName
	 * @param codeUser
	 * @param areaUser
	 * @return
	 * @throws DAOException
	 */
	Collection<ProgramaVO> findProgramaByCriteriaWithGestor(
			ProgramaVO criteria, String groupUserName, Long codeUser,
			Long areaUser) throws DAOException;

}
